package com.googlethemebuilder;

/**
 * 
 * @author lordhong@gmail.com
 * Class for Trait
 *     <Trait name="TimeOfDay">6am-12pm</Trait>
    <Trait name="TimeOfDay">6pm-12am</Trait>
 *
 */
public class Trait {

	private String name;
	private String value;
	
	public Trait() {}
	
	public Trait(String name, String value) {
		super();
		this.name = name;
		this.value = value;
	}
	
	// TODO: validation
	public void setTimeOfDay(String startTime, String endTime) {
		this.name = "TimeOfDay";
		this.value = startTime+"-"+endTime;
	}
	
	public String toXML() {
		StringBuilder sb = new StringBuilder();
		sb.append("<Trait name=\"").append(this.name).append("\">").append(this.value).append("</Trait>");
		return sb.toString();
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}
}
